package com.qishen.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qishen.pojo.Store;
import com.qishen.serviceImpl.StoreServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/store")
public class StoreController {
    @Autowired
    private StoreServiceImpl storeService;
    private int counts = 0;
    private int page = 1;
    private int pageSize = 10;

    // @Autowired
// private StoreService service;
    @GetMapping()
    public List<Store> findAll(int page, int pageSize) {
        IPage<Store> all = storeService.findAll(page, pageSize);
        List<Store> list = all.getRecords();
        return list;
    }
}

